<template>
  <el-dialog
    :title="'See payroll record details'"
    :visible.sync="dialogVisible"
    width="100%"
    :fullscreen="true"
    :modal="false"
    modal-append-to-body
    :before-close="handleClose"
    :destroy-on-close="true">
    <div class="xlSeeFrom">

      <div class="tab-item">
        <!--工资-->
        <div>
          <div class="item">
            <p class="tab-title">Salary</p>
          </div>
          <div class="tab">
            <el-table
              :header-cell-style="{background:'#F2F6FC',color:'#606266'}"
              :data="salaryData"
              ref="salaryData"
              height="330px"
              tooltip-effect="dark"
              border
              style="width:100%">
              <el-table-column label="S/N" type="index" width="60" align="center"></el-table-column>
              <el-table-column
              label="Salary"
              align="center"
              prop="salary_money">
              </el-table-column>
              <el-table-column
              label="Actual payment"
              align="center"
              prop="pay_money">
              </el-table-column>
            </el-table>
          </div>
        </div>

        <!--报销-->
        <div>
          <div class="item">
            <p class="tab-title">Reimbursement</p>
          </div>
          <div class="tab">
            <el-table
              :header-cell-style="{background:'#F2F6FC',color:'#606266'}"
              :data="reData"
              ref="reData"
              height="330px"
              tooltip-effect="dark"
              border
              style="width:100%">
              <el-table-column label="S/N" type="index" width="60" align="center"></el-table-column>
              <el-table-column
              label="NO."
              align="center"
              prop="expense_id">
              </el-table-column>
              <el-table-column
              label="Name"
              align="center"
              prop="expense_name">
              </el-table-column>
              <el-table-column
              align="center"
              label="Project"
              prop="expense_project_name">
              </el-table-column>
              <el-table-column
              label="Submit Time"
              align="center"
              prop="expense_submit_time">
              </el-table-column>
              <el-table-column
              align="center"
              label="Payment Currency"
              prop="expense_payment_currency">
              </el-table-column>
              <el-table-column
              align="center"
              label="Amount"
              prop="total_amount">
              </el-table-column>
            </el-table>
          </div>
        </div>
      </div>

    </div>
    <!-- <span slot="footer" class="dialog-footer">
      <el-button @click="handleClose">关 闭</el-button>
    </span> -->

  </el-dialog>
</template>

<script>
import {getPayrollRecordDetail} from '@/request/other_api'

export default {
  data(){
    return {
        dialogVisible:false,
        //支付凭证数据
        salaryData:[],
        //票据列表
        reData:[],
        //支付凭证表中记录数
        num:0,
    }
  },
  mounted () {
    this.level = sessionStorage.getItem('level')
  },
  methods:{
    //支付凭证页面数据
    formatData(id){
        getPayrollRecordDetail({
            id:id
        }).then(res =>{
            this.salaryData = res.salary_data
            this.reData = res.expense_data
            this.num = this.paymentData.length
        })
    },
    //关闭窗口
    handleClose (done) {
      this.dialogVisible = false
    },
  }
}
</script>

<style lang="less" scoped>
/deep/ .el-form-item__label {
  background-color: #eee;
  text-align: center;
  //width: 121px;
}
/deep/ .el-dialog__header {
  padding: 20px 20px 10px;
  border-bottom: 1px solid #eee;
}
/deep/ .el-dialog__body {
  padding: 10px 20px;
  color: #333;
  font-size: 15px;
  word-break: break-all;
}
.step{
  margin-bottom: 10px;
}
.content{
  margin-top: 10px;
  margin-bottom: 10px;

}
.tab-item{
  width: 100%;
  padding: 10px 0;
  border: 1px solid #eee;

  table{
    width: 100%;
    font-family: verdana,arial,sans-serif;
    font-size:14px;
    color:#333333;
    border-width: 1px;
    border-color: #999999;
    border-collapse: collapse;
  }
  table td{
    border-width: 1px;
    padding: 4px;
    border-style: solid;
    border-color: #999999;
    width: 25%;
  }
  table tr:nth-child(2n+1){
    background-color:#F2F6FC;
    height:50px;
    text-align: center;
  }
  table tr:nth-child(2n){
    background-color: #fff;
    height:50px;
    text-align: center;
  }

.tab-title{
  font-family: SourceHanSansSC;
  font-weight: 700;
  font-size: 20px;
  color: rgb(16, 16, 16);
  font-style: normal;
  letter-spacing: 0px;
  line-height: 30px;
  text-decoration: none;
  padding: 5px 10px;
}
/deep/ .el-date-editor.el-input, .el-date-editor.el-input__inner {
  width: 100%;
 }
}

.tit-header{
    display: flex;
    justify-content: space-between;
    margin: 10px;
}

</style>
